// JavaScript Document
if($.cookie("css")) {
	$("link").attr("href",$.cookie("css"));
}

$(document).ready(function(){
	$('#social-icons li a').mouseenter(function(){
		$(this).stop().animate({'left':'5px'},100);
	}).mouseleave(function(){
		$(this).stop().animate({'left':'0px'},100);
	});

	var newYear = new Date(); 
	newYear = new Date(2012, 1 - 1, 01);
	$('#months.countdown-item p').countdown({
		until: newYear, 
		format: 'yODHMS',
		layout: '{on}'
	});
	$('#days.countdown-item p').countdown({
		until: newYear, 
		format: 'ODHMS',
		layout: '{dn}'
	});
	$('#hours.countdown-item p').countdown({
		until: newYear, 
		format: 'ODHMS',
		layout: '{hn}'
	});
	$('#minutes.countdown-item p').countdown({
		until: newYear, 
		format: 'ODHMS',
		layout: '{mn}'
	});
	$('#seconds.countdown-item p').countdown({
		until: newYear, 
		format: 'ODHMS',
		layout: '{sn}'
	});


	$("#theme-colour a").click(function() {
		var cssLink = $(this).attr('href');
		$("div").fadeOut(1000,function(){
			$("link").attr("href",cssLink);
			$.cookie("css",cssLink, {expires: 365, path: '/'});
			location.reload(true);

		});
		return false;
	});
	
	$('input.textbox').each(function(){
		$(this).example(function() {
		  return $(this).attr('title');
		});
	})
});